<template>
  <div id="app" v-fullscreen>
    <router-view />
    <button @click="dian">点击进入全屏</button>
    <button @click="guan">点击退出全屏</button>
  </div>
</template>

<script>
import { defineComponent, onMounted } from "vue";
import { AppFullscreen } from "quasar";
export default {
  setup() {
    defineComponent({
      name: "App",
    });
    const aaa = true;

    const dian = function () {
      AppFullscreen.request()
        .then(() => {
          // success!
          console.log("成功");
        })
        .catch((err) => {
          // oh, no!!!
          console.log("失败");
        });
    };
    onMounted(() => {
      dian();
      console.log("2222222222222222");
    });
    return {
      aaa,
      dian,
      guan() {
        AppFullscreen.exit()
          .then(() => {
            // success!
          })
          .catch((err) => {
            // oh, no!!!
          });
      },
    };

    // 请求全屏模式：

    // 退出全屏模式：
  },
};
</script>
